var graph = new LGraph();
var canvas = new LGraphCanvas("#graphcanvas", graph);
LiteGraph.clearRegisteredTypes()
graph.start();

(function(global) {
    //node constructor class
    function MyAddNode() {
        this.properties = {
            name: "name",
            xxx: true
        };

        this.addInput("input");
        this.addOutput("output");

        this.name_widget = this.addWidget(
            "text",
            "name",
            this.properties.name,
            this.setName.bind(this)
        );
    }

    MyAddNode.prototype.setName = function (name) {
        this.properties.name = name;
        this.name_widget.value = name;
        // 其他信息
    };
    MyAddNode.prototype.onPropertyChanged = function (name, value) {
        if (name == "name") {
            this.name_widget.value = value;
        }
    };
    //name
    MyAddNode.title = "自定义节点";
    MyAddNode.desc = "描述信息";
    //动态添加输入
    MyAddNode.prototype.onGetInputs = function () {
        return [["input"]];
    };
    //register in the system
    LiteGraph.registerNodeType("基础/customNode", MyAddNode);
})(this);
